/*
 * Copyright 2012-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.jackson;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;

/**
 * 提供一个混入类实现，当使用 {@link JsonMixinModule} 时会注册到 Jackson 中。
 *
 * @author Guirong Hu
 * @see JsonMixinModule
 * @since 2.7.0
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface JsonMixin {

	/**
	 * {@link #type()} 属性的别名。允许更简洁的注解声明，
	 * 例如：{@code @JsonMixin(MyType.class)} 而不是
	 * {@code @JsonMixin(type=MyType.class)}。
	 *
	 * @return 被混入的类
	 * @since 2.7.0
	 */
	@AliasFor("type")
	Class<?>[] value() default {};

	/**
	 * 由提供的混入类处理的类型。{@link #value()} 是此属性的别名
	 * （并且与此属性互斥）。
	 *
	 * @return 被混入的类
	 * @since 2.7.0
	 */
	@AliasFor("value")
	Class<?>[] type() default {};

}
